/**
 * Type Definitions and Prototypes for the Workload Generator
 */
#include <stdlib.h>
#include <pthread.h>
#include <sys/time.h>
#include "cJSON.h"
#include "scheduler.h"

typedef struct resource_model resource_model;

/**
 * translate JSON to a struct the programmer can access easily
 */
cJSON * parse_config(void);

/**
 * Main function
 */
int workload_generator(cJSON *, char *, resource_model * (*)(cJSON *), pthread_t *);
resource_model * foo(cJSON *json);
void * thr_resource(void *);
struct timeval *ms_from_now(double);
unsigned long timeval_diff(struct timeval *, struct timeval *);

struct resource_model {
  void (*birth)(void *);
  void *state;
};
